@mixin cnsl-label-theme($theme) {
  $primary: map-get($theme, primary);
  $primary-color: map-get($primary, 500);
  $is-dark-theme: map-get($theme, is-dark);
  $warn: map-get($theme, warn);
  $warn-color: map-get($warn, 500);
  $foreground: map-get($theme, foreground);
  $secondary-text: map-get($foreground, secondary-text);

  .cnsl-label-wrapper {
    display: flex;
    font-size: 12px;
    color: $secondary-text;
    transition: color 0.2s ease;
    margin-bottom: 4px;
    font-weight: 400;

    .cnsl-label {
      display: block;
    }

    .cnsl-form-field-required-marker {
      margin-left: 1px;
    }
  }

  .cnsl-form-field-disabled {
    .cnsl-label-wrapper {
      color: if($is-dark-theme, #ffffff80, #00000061);
    }
  }

  .cnsl-form-field-invalid {
    .cnsl-label-wrapper {
      color: $warn-color;
    }
  }
}
